package org.finmanager.core;


import java.util.Calendar;
import java.util.GregorianCalendar;

/**
 * Created by Kelvin on 20/3/2014.
 * <p/>
 * This is the Item class
 * Each instance represents an item of financial record
 * Items are primary data for the program and will be used extensively in the program
 * See ItemList class for the abstract list of Items
 * <p/>
 * TODO: create sub class Expense and Income
 */

//This class defines the ITEMS
//AND the GET functions
public class Item {
	private String name;
	private GregorianCalendar date;
	private Double amount;
	private Category category;

	public Item() {

	}

	public Item(String name, int year, int month, int dayOfMonth, double amount, Category category) {
		this.name = name;
		this.amount = amount;
		this.category = category;

		this.date = new GregorianCalendar(year, month, dayOfMonth);
	}

	public String getName() {
		return name;
	}

	public GregorianCalendar getDate() {
		return date;
	}

	public int getYear() {
		return date.get(Calendar.YEAR);
	}

	public int getMonth() {
		return date.get(Calendar.MONTH);
	}

	public int getDayOfMonth() {
		return date.get(Calendar.DAY_OF_MONTH);
	}

	public Double getAmount() {
		return amount;
	}

	public Category getCategory() {
		return category;
	}
}
